home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 22
/
Cream of the Crop 22.iso
/
program
/
eflibpt4.zip
/
DEMO
/
WINDOWS
/
MOVING.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1996-08-03
|
2KB
|
51 lines
{ Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
Demonstration; window moving with mouse or keyboard
EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED. }
uses EFLIBDEF, EFLIBINI, EFLIBWIN, EFLIBBAS, EFLIBIO, EFLIBSCR,
EFLIBKBD, EFLIBTXT;
var Window : EventHandlerObjectType; UserInput : word;
begin
{ Create window using the advanced method (could be replaced with
a simple InitializeWindow call, but without a user defined text
region or automatic coordinate adjustment }
with Window do begin
Initialize; { Initializes window }
{ Width and height is 35 and 10 characters;
let the object calculate coordinates }
AdjustUsing (35, 10);
{ Define a text region (could be replaced with
"MaximizeTextCoordinates" for largest possible text region) }
SetTextCoordinates (Field.Start.X+3, Field.Start.Y+3,
Field.Stop.X-3, Field.Stop.Y-3);
SetHeader ('My window object.'); { Set header }
EnableEmbedding; { Don't give loop control to window }
Draw; { Draw this window }
Clear; { Clear text region and reset cursor position }
end;
{ Scroll text in window and allow moving }
with Window do repeat
Window.Write ('This is a demonstation of EFLIB''s window capabilities...'+
'press CTRL-ENTER to move window with arrow keys! ');
Loop; { Give control to window }
IgnoreExternalEvents; { Ignore any external events }
until IsFinished;
Window.Intercept; { Intercept and dispose window components }
end.